import fetch from '@/utils/fetch'

export function getCardList(areaId, params) {
	return fetch({
	    url: '/accessctrl/v1/mgt/card',
	    method: 'get',
		headers: {'x-area-id': areaId},
	    params
  	})
}

export function getCardDetail(id) {
	return fetch({
	    url: `/accessctrl/v1/mgt/card/${id}`,
	    method: 'get'
  	})
}

export function createCard(data) {
	return fetch({
		url: '/accessctrl/v1/mgt/card',
		method: 'post',
		data
	})
}

export function modifyCard(id, data) {
	return fetch({
	    url: `/accessctrl/v1/mgt/card/${id}`,
	    method: 'patch',
	    data
	})
}
export function modifyCardPhone(phone) {
	return fetch({
	    url: `/uc/v1/mgt/resident/phone/${phone}/intro`,
	    method: 'get',
	    phone
	})
}